home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / amos / ldosv25d.lha / ldos_demo / examples / ldos / Dev.AMOS / Dev.amosSourceCode
AMOS Source Code  |  1992-01-18  |  1KB  |  60 lines

  1. ' This demo uses the trackdisk.device to read directly from the disk.
  2. ' The destinationbuffer MUST be placed in CHIP-mem (blitter decoding)
  3. '  
  4. ' The program reads only 1 block from 1 side of the disk, thus the 
  5. ' speedy loading :-) 
  6. '
  7. ' The numbers printed on the screen are the number of bytes read,
  8. ' 1 block=512 bytes. 
  9. '
  10. ' A simple "meeter" is used to display how much that is left to read.
  11. '
  12. Reserve As Chip Work 10,1024
  13. Proc SETUP
  14. Rem NOTE   CHIP!!
  15. 'Read one block from each track on disk (one side only)
  16. '
  17. A= Extension_10_01AE("trackdisk.device",0,0)
  18. If A<>0
  19.    Print "Failed to open device"
  20.    End 
  21. End If 
  22. 'A=0 if everything worked, 
  23. BEG=0
  24. _END=79
  25. _TOT#=_END-BEG
  26. Locate 0,15 : Print "Status :"
  27. Home 
  28. Curs Off 
  29. For I=BEG To _END
  30.    Proc DISP[I,_END,_TOT#]
  31.    Print Extension_10_01DA(2,Start(10),512,I*22*512);" ";
  32.    ERR= Extension_10_023A 
  33.    ' Syntax is Command,DEST/SOURCE,Length,Offset
  34.    ' All Lengths/offsets MUST be a multiple of 512
  35.    X=X Curs
  36.    Y=Y Curs
  37.    ' See docs for error codes. Try running this demo without a disk in df0: 
  38.    Locate 9,15 : Print ERR
  39.    Locate X,Y
  40. Next I
  41. '
  42. 'Turn off motor  else the drive won't stop 
  43. A= Extension_10_01DA(9,0,0,0)
  44.  Extension_10_01C6 
  45. '<<Close device>>
  46. '
  47. Procedure DISP[A,E,NUM#]
  48.    SCALE#=80/NUM#
  49.    POS=80-(E-A)*SCALE#
  50.    Dec POS
  51.    If E-A=0
  52.       POS=79
  53.    End If 
  54.    Bar 120,150 To 126+(POS*5),170
  55. End Proc
  56. Procedure SETUP
  57.    Screen Open 1,640,256,4,Hires
  58.    Ink 2,
  59.    Box 120,150 To 520,170
  60. End Proc